<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>A页面</title>
</head>
<body>
    <h1>点击传输数据</h1>
</body>
<script>
    /* 创建一个广播通道 */
    const channelObj = new BroadcastChannel('televiseChannel');
    let h1 = document.querySelector('h1');
    h1.onclick = function(){
        // 发送消息
        channelObj.postMessage('标签页1发送信息');
    }
</script>
</html>